package com.fortune.service.impl;

import com.fortune.dao.DSpecificationDao;
import com.fortune.dto.in.dSpecification.DSpecificationAddDto;
import com.fortune.dto.in.dSpecification.DSpecificationEditDto;
import com.fortune.dto.in.dSpecification.DSpecificationListDto;
import com.fortune.service.DSpecificationService;
import com.fortune.vo.dProduct.DProduceSpecification;
import com.fortune.vo.dSpecification.DSpecification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DSpecificationServiceImpl implements DSpecificationService {
    @Autowired
    private DSpecificationDao dSpecificationDao;

    /**
     * 查询规格码表
     * @param did
     * @param specificationListDto
     * @return
     */
    @Override
    public List<DSpecification> queryDSpecificationList(String did, DSpecificationListDto specificationListDto) {
        return dSpecificationDao.queryDSpecificationList(did,specificationListDto);
    }

    /**
     * 查询规格码表个数
     * @param did
     * @param specificationListDto
     * @return
     */
    @Override
    public int queryDSpecificationListCount(String did, DSpecificationListDto specificationListDto) {
        return dSpecificationDao.queryDSpecificationListCount(did,specificationListDto);
    }

    /**
     * 添加规格
     * @param did
     * @param specificationAddDto
     * @return
     */
    @Override
    public int addDSpecification(String did, DSpecificationAddDto specificationAddDto) {
        return dSpecificationDao.addDSpecification(did,specificationAddDto);
    }

    /**
     * 编辑规格
     * @param did
     * @param specificationEditDto
     * @return
     */
    @Override
    public int editDSpecification(String did, DSpecificationEditDto specificationEditDto) {
        return dSpecificationDao.editDSpecification(did,specificationEditDto);
    }

    /**
     * 删除规格
     * @param did
     * @param specificationId
     * @return
     */
    @Override
    public int deleteDSpecification(String did, String specificationId) {
        return dSpecificationDao.deleteDSpecification(did,specificationId);
    }

    /**
     * 添加时查重
     * @param did
     * @param specificationAddDto
     * @return
     */
    @Override
    public int queryAddDSpecificationExist(String did, DSpecificationAddDto specificationAddDto) {
        return dSpecificationDao.queryAddDSpecificationExist(did,specificationAddDto);
    }

    /**
     * 编辑时查重
     * @param did
     * @param specificationEditDto
     * @return
     */
    @Override
    public int queryEditDSpecificationExist(String did, DSpecificationEditDto specificationEditDto) {
        return dSpecificationDao.queryEditDSpecificationExist(did,specificationEditDto);
    }

    /**
     * 查询规格码表
     * @param did
     * @return
     */
    @Override
    public List<DProduceSpecification> queryProduceDSpecificationList(String did) {
        return dSpecificationDao.queryProduceDSpecificationList(did);
    }
}
